package lab_08.com.acme.task5;

public class TextModifier {
	public static void main(String[] args) {
		if (args.length != 1) {
			System.out.println("Wrong number of arguments. One argument is expected.");
			return;
		}
		String str = args[0];
		for (int i = 0; i < str.length(); ++i) {
			char charAtIndex = str.charAt(i);
			if (charAtIndex=='+' || charAtIndex=='-') {
					System.out.format("%1$c%1$c",charAtIndex); //print symbol twice
			}
			else if (Character.isDigit(charAtIndex)) {
				continue; //skip the digit
			}
			else {
				System.out.print(charAtIndex); //print symbol once
			}
		}
	}
}
